<!--
 * @Description: 滚动到底部loading
 * @Author bianpengfei
 * @create 2021/12/27 20:58
 -->
<!--default-->
<script>
export default { name: 'g-loading-end' }
</script>

<!--setup-->
<script setup>
const props = defineProps({
  end: {
    type: Boolean,
    default: false
  },
  loading: {
    type: Boolean,
    default: true
  },
  text: {
    type: [String, Number, Boolean],
    default: false
  }
})
</script>

<!--render-->
<template>
  <div class="wrapper">
    <div class="end" v-if="props.end">没有更多数据了</div>
    <div class="loading" v-if="props.loading">
      <img
        src=""
      />
      <span v-if="text" class="loading-text">正在加载中</span>
    </div>
  </div>
</template>

<!--style-->
<style lang="less" scoped>
img {
  display: block;
}
.wrapper {
  width: 100%;
  height: 1rem;
  .flex-center;
  .end {
    width: 100%;
    height: 0.8rem;
    line-height: 0.8rem;
    font-size: 0.26rem;
    color: #8c8c8c;
    text-align: center;
  }
  .loading {
    width: 100%;
    height: 0.7rem;
    display: flex;
    justify-content: center;
    align-items: center;
    img {
      height: 0.4rem;
      width: 0.4rem;
      margin-right: 0.2rem;
    }
    .loading-text {
      color: #8c8c8c;
      font-size: 0.26rem;
    }
  }
}
</style>
